/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021.
 * Description: Support for dynamic loading of kernel symbols.
 * Author: hanzongcheng
 * Create: 2021-06-15
 */
#ifndef LINUX_RTOS_EXTRACT_KALLSYMS
#define LINUX_RTOS_EXTRACT_KALLSYMS

#ifdef CONFIG_RTOS_EXTRACT_KALLSYMS
#include <linux/types.h>

extern unsigned long rtos_kallsyms_addresses[] __weak;
extern int rtos_kallsyms_offsets[] __weak;
extern u8 rtos_kallsyms_names[] __weak;
extern char rtos_kallsyms_token_table[] __weak;
extern u16 rtos_kallsyms_token_index[] __weak;
extern unsigned int rtos_kallsyms_markers[] __weak;

extern unsigned int kallsyms_num_syms __weak;
extern unsigned long kallsyms_relative_base __weak;
extern unsigned long *kallsyms_addresses __weak;
extern int *kallsyms_offsets __weak;
extern u8 *kallsyms_names __weak;
extern char *kallsyms_token_table __weak;
extern u16 *kallsyms_token_index __weak;
extern unsigned int *kallsyms_markers __weak;

extern unsigned int rtos_mod_kallsyms_num_syms __weak;
extern unsigned long rtos_mod_kallsyms_addresses[] __weak;
extern int rtos_mod_kallsyms_offsets[] __weak;
extern u8 rtos_mod_kallsyms_names[] __weak;
extern char rtos_mod_kallsyms_token_table[] __weak;
extern u16 rtos_mod_kallsyms_token_index[] __weak;
extern unsigned int rtos_mod_kallsyms_markers[] __weak;

struct rtos_kallsyms_struct {
	unsigned int *num_syms;
	unsigned long *relative_base;
	int *offsets;
	u8 *names;
	char *token_table;
	u16 *token_index;
	unsigned int *markers;
};

extern int rtos_kallsyms_init(struct rtos_kallsyms_struct *symbuf);
#endif
#endif
